#import <Foundation/Foundation.h>

#import "../model/Content.h"
#import "RequestConfig.h"
#ifndef ContentRequest_h
#define ContentRequest_h

@interface ContentRequest : NSObject

@property (nonatomic,weak) RequestConfig* config;
- (void)initReq:(RequestConfig*)config;
+ (id)defaultContentRequest;
# pragma content
- (void)getPublicContents:(NSInteger)page eachPage:(NSInteger)eachPage
                  success:(nullable void (^)(NSArray<Content*>* contents))success
                  failure:(nullable void (^)(NSString* reason))failure;
- (void)getContentByID:(NSString*)contentID
               success:(nullable void (^)(Content*))success
               failure:(nullable void (^)(NSString* reason))failure;
- (void)deleteContentByID:(NSString*)contentID
                  success:(nullable void (^)(void))success
                  failure:(nullable void (^)(NSString* reason))failure;
- (void)getFileBy:(ContentFileReq*)req
      destination:(NSURL*)destination
          success:(nullable void (^)(void))success
          failure:(nullable void (^)(NSString* reason))failure;

# pragma text
- (void)getTextContents:(NSString*)userID
                success:(nullable void (^)(NSMutableArray<Content*>*))success
                failure:(nullable void (^)(NSString* reason))failure;

- (void)postTextContent:(TextContent*)text
                success:(nullable void (^)(void))success
                failure:(nullable void (^)(NSString* reason))failure;

- (void)replaceTextContent:(NSString*)contentID
                      text:(TextContent*)text
                   success:(nullable void (^)(void))success
                   failure:(nullable void (^)(NSString* reason))failure;

# pragma album
- (void)getAlbumContents:(NSString*)userID
                 success:(nullable void (^)(NSMutableArray<Content*>*))success
                 failure:(nullable void (^)(NSString* reason))failure;

- (void)postAlbumContent:(TextContent*)text
              withImages:(NSArray<UIImage*>*)images
                 success:(nullable void (^)(void))success
                 failure:(nullable void (^)(NSString* reason))failure;

@end
#endif
